﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MCK_TimeKeeper.ascx.cs" Inherits="ERP.Modules.MCK_TimeKeeper" %>
<%-------------------------------%>
<ext:Hidden ID="FormatTypeTimeKeeper" runat="server" />
<%--------------GridTimeKeeper-----------------%>
<ext:Panel runat="server" Layout="Fit" Border="False" ID="PanelTimeKeeper">
    <Content>
        <ext:GridPanel
            ID="GridPanel1"
            runat="server"
            Cls="grid-double"
            EnableColumnMove="true"
            Border="False">
            <Store>
                <ext:Store
                    ID="StoreTimeKeeper"
                    runat="server"
                    OnReadData="StoreTimeKeeper_RefreshData"
                    PageSize="22">
                    <Model>
                        <ext:Model ID="Model2" runat="server" IDProperty="Employee_ID">
                            <Fields>
                                <ext:ModelField Name="Month" Type="String" />
                                <ext:ModelField Name="SchClass_ID" Type="String" />
                                <ext:ModelField Name="SchClass_Name" Type="String" />
                                <ext:ModelField Name="Bank_Code" Type="String" />
                                <ext:ModelField Name="FullName" Type="String" />
                                <ext:ModelField Name="Job_Name" Type="String" />
                                <ext:ModelField Name="Part_Name" Type="String" />
                                <ext:ModelField Name="Department_Name" Type="String" />
                                <ext:ModelField Name="Absent" Type="String" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumn2" runat="server" Text="STT" Width="30" Align="Center" />
                    <ext:Column ID="Column7" runat="server" Text="Tháng" Width="70" DataIndex="Month"></ext:Column>
                    <ext:Column ID="Column8" runat="server" Text="Ca làm" Width="70" DataIndex="SchClass_Name"></ext:Column>
                    <ext:Column ID="Column9" runat="server" Text="Mã nhân viên" Width="100" DataIndex="Bank_Code"></ext:Column>
                    <ext:Column ID="Column10" runat="server" Text="Nhân viên" Width="200" DataIndex="FullName" Flex="1"></ext:Column>
                    <ext:Column ID="Column12" runat="server" Text="Chức vụ" Width="125" DataIndex="Job_Name"></ext:Column>
                    <ext:Column ID="Column13" runat="server" Text="Bộ phận" Width="125" DataIndex="Part_Name"></ext:Column>
                    <ext:Column ID="Column14" runat="server" Text="Phòng ban" Width="125" DataIndex="Department_Name"></ext:Column>
                    <ext:Column ID="Column15" runat="server" Text="Số ngày vắng trong tháng" Width="125" DataIndex="Absent"></ext:Column>
                </Columns>
            </ColumnModel>
            <DirectEvents>
                <ItemDblClick OnEvent="TimeKeeperDblClick">
                    <ExtraParams>
                        <ext:Parameter Name="Month" Value="record.data.Month" Mode="Raw" />
                        <ext:Parameter Name="SchClass_ID" Value="record.data.SchClass_ID" Mode="Raw" />
                        <ext:Parameter Name="Employee_ID" Value="record.data.Bank_Code" Mode="Raw" />
                    </ExtraParams>
                    <EventMask ShowMask="true" Msg="Đang tải..." />
                </ItemDblClick>
            </DirectEvents>
            <View>
                <ext:GridView ID="GridView2" runat="server" StripeRows="true" />
            </View>
            <DockedItems>
                <ext:Toolbar ID="Toolbar1" runat="server" Dock="Top">
                    <Items>
                        <ext:SelectBox ID="cbMonth" runat="server" FieldLabel="Tháng" LabelWidth="50" MarginSpec="0 10 0 0" Width="130">
                            <Items>
                                <ext:ListItem Text="Tháng 1" Value="1" />
                                <ext:ListItem Text="Tháng 2" Value="2" />
                                <ext:ListItem Text="Tháng 3" Value="3" />
                                <ext:ListItem Text="Tháng 4" Value="4" />
                                <ext:ListItem Text="Tháng 5" Value="5" />
                                <ext:ListItem Text="Tháng 6" Value="6" />
                                <ext:ListItem Text="Tháng 7" Value="7" />
                                <ext:ListItem Text="Tháng 8" Value="8" />
                                <ext:ListItem Text="Tháng 9" Value="9" />
                                <ext:ListItem Text="Tháng 10" Value="10" />
                                <ext:ListItem Text="Tháng 11" Value="11" />
                                <ext:ListItem Text="Tháng 12" Value="12" />
                            </Items>
                        </ext:SelectBox>

                        <ext:SelectBox
                            ID="cbSchClass"
                            runat="server"
                            FieldLabel="Ca làm việc"
                            LabelWidth="70"
                            MarginSpec="0 10 0 0"
                            Width="150"
                            DisplayField="SchClass_Name"
                            ValueField="SchClass_ID"
                            EmptyText="Chọn ca">
                            <Store>
                                <ext:Store ID="StoreShclass" runat="server">
                                    <Model>
                                        <ext:Model ID="Model3" runat="server">
                                            <Fields>
                                                <ext:ModelField Name="SchClass_Name" />
                                                <ext:ModelField Name="SchClass_ID" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                        </ext:SelectBox>
                        <ext:ToolbarFill />
                        <ext:Button ID="Button1" runat="server" Text="Chấm công" Icon="TimeAdd" StandOut="True">
                            <DirectEvents>
                                <Click OnEvent="btnTimeKeeper_Click">
                                    <EventMask ShowMask="true" Msg="Đang tải..." />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                        <ext:ToolbarSeparator />
                    </Items>
                </ext:Toolbar>
                <ext:Toolbar ID="Toolbar2" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                    <Items>
                        <ext:TriggerField ID="TriggerField2" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                            <Triggers>
                                <ext:FieldTrigger Icon="Search" />
                            </Triggers>
                            <DirectEvents>
                                <TriggerClick OnEvent="SearchTimeKeeper_Event"></TriggerClick>
                            </DirectEvents>
                        </ext:TriggerField>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server" StoreID="StoreTimeKeeper" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                    </Items>
                </ext:Toolbar>
            </DockedItems>
        </ext:GridPanel>
    </Content>
</ext:Panel>
<ext:Panel ID="Panel1" runat="server">
    <Content>
        <%-----------WindowsTimeKeeper-----------------%>
        <ext:Window ID="WindowsTimeKeeperDetail" runat="server"
            Title="Chi tiết chấm công nhân viên"
            Width="830"
            Height="300"
            Hidden="true"
            Region="Center"
            Resizable="False"
            Modal="true"
            Layout="Fit"
            PaddingSummary="5px 5px 0">
            <Content>
                <ext:GridPanel
                    ID="grTimeKeeperDetail"
                    runat="server"
                    Cls="grid-double"
                    EnableColumnMove="true"
                    Border="False">
                    <Store>
                        <ext:Store
                            ID="StoreTimeKeeperDetail"
                            runat="server"
                            OnReadData="StoreTimeKeeperDetail_RefreshData"
                            PageSize="10">
                            <Model>
                                <ext:Model ID="Model1" runat="server">
                                    <Fields>
                                        <ext:ModelField Name="Month" Type="String" />
                                        <ext:ModelField Name="SchClass_Name" Type="String" />
                                        <ext:ModelField Name="Day" Type="String" />
                                        <ext:ModelField Name="Date" Type="Date" />
                                        <ext:ModelField Name="CheckIn" Type="Date" />
                                        <ext:ModelField Name="CheckOut" Type="Date" />
                                        <ext:ModelField Name="WorkHour" Type="String" />
                                        <ext:ModelField Name="WorkMinutes" Type="String" />
                                        <ext:ModelField Name="Symbol_TimeKeeper_Alias" Type="String" />
                                        <ext:ModelField Name="Symbol_TimeKeeper_Name" Type="String" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel runat="server">
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn3" runat="server" Text="STT" Width="30" Align="Center" />
                            <ext:Column ID="Column19" runat="server" Text="Thứ" Width="100" DataIndex="Day"></ext:Column>
                            <ext:DateColumn ID="DateColumn1" runat="server" Text="Ngày" Width="100" DataIndex="Date" Format="dd-MM-yyyy"></ext:DateColumn>
                            <ext:DateColumn ID="DateColumn2" runat="server" Text="Thời gian vào" Width="100" DataIndex="CheckIn" Format="HH:mm"></ext:DateColumn>
                            <ext:DateColumn ID="DateColumn3" runat="server" Text="Thời gian ra" Width="100" DataIndex="CheckOut" Format="HH:mm"></ext:DateColumn>
                            <ext:Column ID="Column20" runat="server" Text="Giờ làm việc" Width="100" DataIndex="WorkHour"></ext:Column>
                            <ext:Column ID="Column21" runat="server" Text="Phút làm việc" Width="100" DataIndex="WorkMinutes" Flex="1"></ext:Column>
                            <ext:Column ID="Column1" runat="server" Text="Kí hiệu" Width="100" DataIndex="Symbol_TimeKeeper_Alias" Flex="1"></ext:Column>
                            <ext:Column ID="Column2" runat="server" Text="Lý do nghỉ" Width="100" DataIndex="Symbol_TimeKeeper_Name" Flex="1"></ext:Column>
                        </Columns>
                    </ColumnModel>
                    <View>
                        <ext:GridView ID="GridView3" runat="server" StripeRows="true" />
                    </View>
                    <DockedItems>
                        <ext:Toolbar ID="Toolbar3" runat="server" Dock="Bottom" AnchorHorizontal="100%">
                            <Items>
                                <ext:TriggerField ID="TriggerField1" runat="server" Width="200" EnableKeyEvents="true" MarginSpec="0 8 0 0">
                                    <Triggers>
                                        <ext:FieldTrigger Icon="Search" />
                                    </Triggers>
                                    <DirectEvents>
                                        <TriggerClick OnEvent="SearchTimeKeeperDetail_Event"></TriggerClick>
                                    </DirectEvents>
                                </ext:TriggerField>
                                <ext:PagingToolbar ID="PagingToolbar2" runat="server" StoreID="StoreTimeKeeperDetail" BeforePageText="Trang" AfterPageText="của {0}" LastText="Cuối" NextText="Kế tiếp" PrevText="Trở lại" FirstText="Đầu" RefreshText="Làm tươi" DisplayInfo="true" DisplayMsg="Trang {0} - {1} của {2}" />
                            </Items>
                        </ext:Toolbar>
                    </DockedItems>
                </ext:GridPanel>
            </Content>
        </ext:Window>
    </Content>
</ext:Panel>
